<h1>Listing products</h1>

<table class="list">
  <tr>
	<th></th>
  	<th>Code</th>
	<th>Name</th>
	<th>Price</th>
  	<th colspan='3'>Action</th>
</tr>
<% for product in @products %>
  <tr>
    <td><%= image_tag(product.image_path) %></td>
	<td><%=h product.code %></td>
	<td><%=h product.name %></td>
	<td><%=h number_to_currency(product.price) %></td>
	<td><%= link_to 'Show', product_path(product) %></td>
    <td><%= link_to 'Edit', edit_product_path(product) %></td>
    <td><%= link_to 'Destroy', product_path(product), :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New product', :controller => 'products', :action => 'new' %>
